// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/water/api/WaterDeviceApi'

import OneClass from '@api/water/model/SelfDeviceDetailReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  async getOne({ id }, TIP = '查询设备详情') {
    const DTO = CORE.grpcDTO(OneClass, { id })
    const { deviceDto, content } = await CORE.grpc(TIP, CLIENT, 'selfDeviceDetail', DTO)
    return { ...deviceDto, content }
  },
}
